<template>
  <el-dialog title="选择角色"
             :close-on-click-modal="false"
             :visible.sync="dialogShow"
             width="840px"
             :before-close="handleClose">
    <el-form :model="dialogForm"
             ref="dialogForm"
             label-width="100px">
      <el-form-item label="选择角色："
                    prop="roleName">
        <el-radio-group v-model="dialogForm.roleName">
          <el-radio :label="item"
                    v-for="item in roleList"
                    :key="item"></el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <span slot="footer"
          class="dialog-footer">
      <el-button @click="handleClose"
                 size="small">取 消</el-button>
      <el-button type="primary"
                 @click="sure"
                 size="small">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: {
    dialogShow: Boolean,
    sure: Function,
    dialogForm: Object
  },
  data () {
    return {
      roleList: ['学校用户', '学院用户', '年级辅导员', '物业用户']
    }
  },
  methods: {
    handleClose () {
      this.$refs.dialogForm.resetFields()
      this.$emit('handleClose')
    }
  }
}
</script>
